package com.olmarket.core.exception;

import com.olmarket.core.api.IErrorCode;
import lombok.Getter;

/**
 * @author: qwesde@hust.edu.cn
 * @date: 2021/2/5 18:50
 */
@Getter
public class ApiException extends RuntimeException {

    private IErrorCode errorCode;

    public ApiException(IErrorCode errorCode) {
        super(errorCode.getMsg());
        this.errorCode = errorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public IErrorCode getErrorCode() {
        return errorCode;
    }
}
